package com.mdxl.JPA.controller;

import com.mdxl.Entity.Account;
import com.mdxl.Entity.User;
import com.mdxl.JPA.dao.JpaDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by chengjian on 2017/9/18.
 */
@RestController
@RequestMapping(value = "/jpa")
public class JpaController {
    @Autowired
    private JpaDao jpaDao;
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public List<User> getAccounts() {
        return jpaDao.findAll();
    }
}
